import _ from "underscore"
const cache = {
    state: {
        info: {},
        info2: {},
    },

    mutations: {
        ADD_CACHE: (state, cache) => {
            if(state.info[cache.cacheId]){

            } else {
                state.info[cache.cacheId] = cache
            }
        },
        DEL_CACHE: (state, cache) => {
            state.info[cache.cacheId] = undefined 
        },
        ADD_CACHE_2: (state, cache) => {
            if(state.info2[cache.cacheId]){

            } else {
                state.info2[cache.cacheId] = cache
            }
        },
        DEL_CACHE_2: (state, cache) => {
            state.info2[cache.cacheId] = undefined 
        },
    },

    actions: {
        addCache({ commit, state }, cache) {
            // var s = JSON.stringify(cache)
            commit('ADD_CACHE', cache)
        },
        delCache({ commit, state }, cache) {
            commit('DEL_CACHE', cache)
        },
        addCache2({ commit, state }, cache) {
            // var s = JSON.stringify(cache)
            commit('ADD_CACHE_2', cache)
        },
        delCache2({ commit, state }, cache) {
            commit('DEL_CACHE_2', cache)
        }
    }
};

export default cache;
